package com.ywjt.pinkelephant.my.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.ywjt.pinkelephant.R;
import com.ywjt.pinkelephant.base.BaseActivity;
import com.ywjt.pinkelephant.dynamic.adapter.PodCastDetailAdapter;
import com.ywjt.pinkelephant.dynamic.model.MenauModel;
import com.ywjt.pinkelephant.my.adapter.VipSetMealAdapter;

import java.util.ArrayList;
import java.util.List;

public class ActivityVipCenter extends BaseActivity implements View.OnClickListener {

    private RecyclerView rcCommon,rcMenu;
    private VipSetMealAdapter mealAdapter;
    private PodCastDetailAdapter detailAdapter;
    private List<String> data;
    private List<MenauModel> menauModelList;
    private TextView tvSurePay;
    private ImageView ivBack;
    public static void actionStart(Context context ) {
        Intent intent = new Intent(context, ActivityVipCenter.class);
        context.startActivity(intent);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tvSurePay:
                ActivityVipPayMent.actionStart(ActivityVipCenter.this);
                break;
            case R.id.ivBack:
                finish();
                break;
        }
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        setAndroidNativeLightStatusBar(true);
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.activity_vip_center;
    }

    @Override
    protected void initView() {
        rcCommon=findViewById(R.id.rcCommon);
        tvSurePay=findViewById(R.id.tvSurePay);
        rcMenu=findViewById(R.id.rcMenu);
        ivBack=findViewById(R.id.ivBack);
        data=new ArrayList<>();
        data.add("");
        data.add("");
        data.add("");
        mealAdapter=new VipSetMealAdapter(data);
        rcCommon.setLayoutManager(new GridLayoutManager(ActivityVipCenter.this,3,RecyclerView.VERTICAL,false));
        rcCommon.setAdapter(mealAdapter);
        tvSurePay.setOnClickListener(this::onClick);
        ivBack.setOnClickListener(this::onClick);

        menauModelList=new ArrayList<>();
        menauModelList.add(new MenauModel("35%分享佣金",R.mipmap.icon_vip1));
        menauModelList.add(new MenauModel("ai语音提词",R.mipmap.icon_vip2));
        menauModelList.add(new MenauModel("万能悬浮",R.mipmap.icon_vip3));
        menauModelList.add(new MenauModel("高清画质",R.mipmap.icon_vip4));
        menauModelList.add(new MenauModel("电脑版提词功能",R.mipmap.icon_vip5));
        menauModelList.add(new MenauModel("语音输入台本",R.mipmap.icon_vip6));
        menauModelList.add(new MenauModel("视频转台本",R.mipmap.icon_vip7));
        menauModelList.add(new MenauModel("链接转台本",R.mipmap.icon_vip8));
        menauModelList.add(new MenauModel("提词板模式",R.mipmap.icon_vip9));
        menauModelList.add(new MenauModel("10000+爆款文案",R.mipmap.icon_vip10));
        menauModelList.add(new MenauModel("视频转台本",R.mipmap.icon_vip11));
        menauModelList.add(new MenauModel("99元视频号课",R.mipmap.icon_vip12));
        menauModelList.add(new MenauModel("视频号教程",R.mipmap.icon_vip13));
        menauModelList.add(new MenauModel("大咖分享",R.mipmap.icon_vip14));
        menauModelList.add(new MenauModel("分销培训支持",R.mipmap.icon_vip15));
        menauModelList.add(new MenauModel("专属客服",R.mipmap.icon_vip16));
        LinearLayoutManager layoutManager = new GridLayoutManager(ActivityVipCenter.this,4,RecyclerView.VERTICAL,false) {
            @Override
            public boolean canScrollVertically() {
                // 直接禁止垂直滑动
                return false;
            }
        };
        rcMenu.setLayoutManager(layoutManager);
        detailAdapter=new PodCastDetailAdapter(menauModelList);
        rcMenu.setAdapter(detailAdapter);
    }

    @Override
    protected void initData() { }
    /**
     * 获取要使用的标题栏样式(此函数由子类重写)
     */
    @Override
    protected int getTitleBarType() {
        return TITLEBAR_NULL;
    }
}